<?php
	$fields_arr = array(
		'member_username'=>'会员用户',
		'to_member_moblie'=>'发送对象',
        'tmpl_name'=>'模板名称',
        'to_status_text'=>'发送状态',
        'manager_name'=>'发送人',
        'to_time'=>'发送时间',
        'operation'=>'操作',
    );
    if(!$custom_field_arr){
        $custom_field_arr = array_flip($fields_arr);
    }
    $fields_arr_new = array_merge($custom_field_arr,array_flip($fields_arr));
    $fields_arr_new = array_unique($fields_arr_new);
?>
{include app:admin.inc.header}
<!--tmpl-resource-->
{include app:admin.inc.top}
<link rel="stylesheet" href="/res/js/framework/nestable/nestable.css">
<div class="container-fluid content-body">
    <div class="main">
        <!-- left side start-->

        <section class="left-section">
            <dl id="leftNav" data-type="setting">
                <dt><i class="glyphicon glyphicon-wrench"></i> 网站设置</dt>
                {if in_case_array('admin/setting',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/setting/index}">站点设置</a></dd>
                {/if}
                {if in_case_array('admin/nav',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/nav/index}">导航设置</a></dd>
                {/if}
                {if in_case_array('admin/friendLink',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/friendLink/index}">友情链接</a></dd>
                {/if}
                {if in_case_array('admin/remind',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/remind/index}">站内提醒</a></dd>
                {/if}
                {if in_case_array('admin/remindSms',$priv) || empty($priv)}
                <dd><a class="mb active" href="{url /admin/remindSms/index}">短信提醒</a></dd>
                {/if}
                {if in_case_array('admin/security',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/security/index}">安全中心</a></dd>
                {/if}
                {if in_case_array('admin/remind',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/message/index}">消息中心</a></dd>
                {/if}
                {if in_case_array('admin/loginlog',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/LoginLog/index}">登录日志</a></dd>
                {/if}
                {if in_case_array('admin/operationlog',$priv) || empty($priv)}
                <dd><a class="mbh" href="{url /admin/operationLog/index}">操作日志</a></dd>
                {/if}
            </dl>
        </section>

        <!-- left side end-->


        <!-- main content start-->
        <section class="right-section" id="right-section">
            {include admin.inc.bread}
            <ul class="nav nav-tabs">
                <li class="active"><a>短信列表</a></li>
                <li><a href="{url /admin/remindSms/ruleIndex}"><i class="css-list"></i>规则列表</a></li>
                <li><a href="{url /admin/remindSms/tmplIndex}"><i class="css-list"></i>模板列表</a></li>
            </ul>
            <!-- start of inner-frame -->
            <div class="inner-iframe">

                <div class="inner-container">
                    <form class="form-inline search-form" role="form">
                        <nav class="inline-form">
                            <a class="btnlg mb" href="{url /admin/remindSms/add}"><i class="css-add"></i>添加短信</a>
                            <div class="r">
                                <div class="css-select-group">
                                    <div class="css-select">
                                        <div class="chosen">
                                            <span></span>
                                            <i class="angle-down"></i>
                                            <input type="hidden" name="select_mix_option1" value="{$search_arr[select_mix_option1]}">
                                        </div>
                                        <ul>
                                            <li data-value="member_no">会员号</li>
                                            <li data-value="tmpl_name">模板名称</li>
                                        </ul>
                                    </div><input type="text" class="form-control input-sm" maxlength="{maxlength}" placeholder="关键字" name="select_mix_option_value1" value="{$search_arr[select_mix_option_value1]}">
                                </div>
                                <div class="css-select">
                                    <div class="chosen">
                                        <span></span>
                                        <i class="angle-down"></i>
                                        <input type="hidden" name="select_mix_option2" value="{$search_arr[select_mix_option2]}">
                                    </div>
                                    <ul>
                                        <li data-value="to_time">发送时间</li>
                                    </ul>
                                </div>
                                <!-- searchdatetime -->
                                <div class="form-group">
                                    <div class="input-group">

                                        <input style="width:100px;" class="form-control form-control-inline input-sm mdate"
                                               size="16" type="text"
                                               name="start_time" value="{$search_arr[start_time]}"
                                               placeholder="开始时间"/>

                                        <div class="input-group-addon">
                                            -
                                        </div>
                                        <input style="width:100px;" class="form-control form-control-inline input-sm mdate"
                                               size="16" type="text"
                                               name="end_time" value="{$search_arr[end_time]}"
                                               placeholder="结束时间"/>
                                    </div>
                                </div>


                                <div class="input-group">
                                    <div class="input-group-addon">
                                        发送人
                                    </div>
                                    <input type="text" class="form-control input-sm" maxlength="20" placeholder="关键词"
                                           name="manager_name" value="{$search_arr['manager_name']}">
                                </div>

                                <input type="hidden" name="order" value="{$order}">
                                <button type="submit" class="btnlg mb">搜索</button>
                                <input type="hidden" name="pagesize" value="{$pagesize}" >
                                <button type="button" class="btnlg mb" id="defined">配置列表项</button>
                            </div>
                        </nav>

                    </form>
                    <form id="J_List_Form">
                        <div class="table-responsive">
                            <table id="J_ListTable" class="table  table-hover  table-striped">
                                <thead>
                                <tr>
                                    <th width="20">
                                        <label class="css-checkbox">
                                            <input type="checkbox" class="check-all">
                                            <span></span>
                                        </label>
                                    </th>
                                    {loop $custom_field_arr $k $v}
                                    <th>{$fields_arr[$v]}</th>
                                    {/loop}
                                </tr>
                                </thead>
                                <tbody>
                                {if empty($items)}
                                <tr>
                                    <td style="text-align:center;" colspan="5" class="empty-table-td">{$emptyRecord}
                                    </td>
                                </tr>
                                {/if}
                                {loop $items $value}
                                <tr data-id="{$value[id]}">
                                    <td>
                                        <label class="css-checkbox">
                                            <input type="checkbox"  name="ids[]" value="{$value[id]}">
                                            <span></span>
                                        </label>
                                    </td>
                                    {loop $custom_field_arr $v}
                                    {if $v=='operation'}
                                    <td>
                                        {if in_case_array('admin/remindsms/getremindbyid',$priv) || empty($priv)}
                                        <a href="javascript:void(0)" class="btnsm-primary js-remind-details">
                                            详情</a>
                                        {/if}
                                        {if $value[to_status]!=1}
                                        <a href="javascript:void(0)" class="btnsm-success item-bind js-remind-retransmission">
                                            重发</a>
                                        {/if}
                                    </td>
                                    {else}
                                    <td>{$value[$v]}</td>
                                    {/if}
                                    {/loop}
                                </tr>
                                {/loop}
                            </table>
                        </div>
                    </form>
                    <div class="text-right" style="float: right">
                        {$pagemenu}
                    </div>
                </div>
            </div>
        </section>
    </div>
</div>

<!--footer section start-->
{include admin.inc.footer}
<!--footer section end-->


<!--自定义start-->
<script id="defined_table" type="text/html">
    <div>
        <form id="defined_edit" class="form-horizontal">
            <input type="hidden" name="url" value="{$module}/{$action}/{$method}">
            <div class="de_title"><i></i>拖动改变顺序</div>
            <div class="cf">
                <div class="dd" id="nestable3">
                    <ol class="dd-list">
                        {loop $fields_arr_new $v}
                        <li class="dd-item dd3-item" data-id="{$v}">
                            <div class="dd-handle dd3-handle"></div><div class="dd3-content">
                            <label class="css-checkbox">
                                <input type="checkbox" {if in_array($v,$custom_field_arr)}checked="checked"{/if} name="field_arr[]" value="{$v}">
                                <span>{$fields_arr[$v]}</span>
                            </label>
                        </div>
                        </li>
                        {/loop}
                    </ol>
                </div>
            </div>
        </form>
    </div>
</script>
<!--自定义end-->

<!-- pagescript -->
<script type="text/javascript">
    seajs.use("admin/message_remindindex", function (parameter) {

        /**--tmpl-templatejavascript--**/

        <!--tmpl-templatejavascript-->
        parameter.detailUrl = "{$detail_url}";
        parameter.deleteUrl = "{$delete_url}";
        parameter.editUrl = "{$do_edit_url}";
        parameter.upload_url = "{$upload_url}";
        parameter.image_search_url = "{$image_search_url}";
        parameter.image_list_url = "{$image_list_url}";

        parameter.init();
    });
</script>


<script id="remind-details" type="text/template">

    <div class="tab-content" style="padding: 25px 20px;">
        以下信息不可修改
        <from class="form-horizontal basicForm">
            <div class="form-group" style="padding: 5px 10px;">

                <label class="col-sm-3 control-label">模板名称 </label>
                <div class="col-sm-4">
                    <label class="control-label">{[tmpl_name]} </label>
                </div>
            </div>
            <div class="form-group" style="padding: 5px 10px;">

                <label class="col-sm-3 control-label">短信内容 </label>
                <div class="col-sm-8" >
                    <label class="control-label" style="text-align: left">{[to_content]}</label>
                </div>
            </div>
            <div class="form-group" style="padding: 5px 10px;">

                <label class="col-sm-3 control-label">发送人 </label>
                <div class="col-sm-4">
                    <label class="control-label">{[manager_name]} </label>
                </div>
            </div>
            <div class="form-group" style="padding: 5px 10px;">

                <label class="col-sm-3 control-label">发送时间 </label>
                <div class="col-sm-4">
                    <label class="control-label">{[to_time]} </label>
                </div>
            </div>
        </from>
    </div>
</script>
</body>
</html>
